{namespace dce=ArminVieweg\Dce\ViewHelpers}<?php
<f:for each="{dceArray}" as="dce">
<f:if condition="{dce.hidden} == 0">
///////////////////////////////////////////////////// {f:if(condition:"{dce.uid}", then:"uid: {dce.uid}", else:"identifier: {dce.identifier}")} ///
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
	'ArminVieweg.dce',
	'{f:if(condition:"{dce.uid}", then:"dceuid{dce.uid}", else:"dce_{dce.identifier}")}',
	array(
		'Dce' => 'show',
	),
	array(
		<f:if condition="{dce.cache_dce}"><f:then></f:then>
            <f:else>'Dce' => 'show'</f:else></f:if>
	),
    \TYPO3\CMS\Extbase\Utility\ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
);

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript('dce', 'setup', '
# Hide lib.stdheader for DCE with uid {dce.uid}
' . 'tt_content.dce_{f:if(condition:"{dce.uid}", then:"dceuid{dce.uid}", else:"{dce.identifier}")}.10 >', 43);

<f:if condition="{dce:be.extensionLoaded(key:'css_styled_content')}">
<f:if condition="{dce.hide_default_ce_wrap}">
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript('dce', 'setup', '
# Hide default wrapping for content elements for DCE with uid {dce.uid}
' . 'tt_content.stdWrap.innerWrap.cObject.default.stdWrap.if.value := addToList(dce_{f:if(condition:"{dce.uid}", then:"dceuid{dce.uid}", else:"{dce.identifier}")})', 43);
</f:if>
</f:if>
<f:if condition="{dce.wizard_enable}">
	<f:if condition="{dce.hasCustomWizardIcon}">
		if (\TYPO3\CMS\Core\Utility\GeneralUtility::compat_version('7.6')) {
		$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Core\Imaging\IconRegistry');
		$iconRegistry->registerIcon(
		'ext-dce-{f:if(condition:"{dce.uid}", then:"dceuid{dce.uid}", else:"dce_{dce.identifier}")}-customwizardicon',
		'TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider',
		array('source' => '{dce.wizard_custom_icon}')
		);
		}
	</f:if>
	\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('
	mod.wizards.newContentElement.wizardItems.{dce.wizard_category}.elements.dce_{f:if(condition:"{dce.uid}", then:"dceuid{dce.uid}", else:"dce_{dce.identifier}")} {
	<f:if condition="{dce:be.version.typo3(returnInt:'1')} < 7006000">
		<f:then>
			icon = <f:if condition="{dce.hasCustomWizardIcon}"><f:then>../{dce.wizard_custom_icon}</f:then><f:else>{dce:be.contentElementWizardIconPath(name:'{dce.wizard_icon}')}</f:else></f:if>
		</f:then>
		<f:else>
			iconIdentifier = <f:if condition="{dce.hasCustomWizardIcon}"><f:then>ext-dce-dceuid{dce.uid}-customwizardicon</f:then><f:else>{dce:be.contentElementWizardIconPath()}{dce.wizard_icon}</f:else></f:if>
		</f:else>
	</f:if>
	title = {dce.title -> dce:format.addcslashes()}
	description = {dce.wizard_description -> f:format.raw() -> dce:format.addcslashes()}
	tt_content_defValues {
	CType = dce_{f:if(condition:"{dce.uid}", then:"dceuid{dce.uid}", else:"dce_{dce.identifier}")}
	}
	}
	mod.wizards.newContentElement.wizardItems.{dce.wizard_category}.show := addToList(dce_{f:if(condition:"{dce.uid}", then:"dceuid{dce.uid}", else:"dce_{dce.identifier}")})
	');
</f:if>
</f:if>
</f:for>
